3.45 \(\int \frac {(d+e x) (A+B x+C x^2)}{a+c x^2} \, dx\)

Optimal. Leaf size=93 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) (A c d-a (B e+C d))}{\sqrt {a} c^{3/2}}+\frac {\log \left (a+c x^2\right ) (-a C e+A c e+B c d)}{2 c^2}+\frac {x (B e+C d)}{c}+\frac {C e x^2}{2 c} \]

[Out]

(B*e+C*d)*x/c+1/2*C*e*x^2/c+1/2*(A*c*e+B*c*d-C*a*e)*ln(c*x^2+a)/c^2+(A*c*d-a*(B*e+C*d))*arctan(x*c^(1/2)/a^(1/
2))/c^(3/2)/a^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {1629, 635, 205, 260} \[ \frac {\log \left (a+c x^2\right ) (-a C e+A c e+B c d)}{2 c^2}+\frac {\tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) (A c d-a (B e+C d))}{\sqrt {a} c^{3/2}}+\frac {x (B e+C d)}{c}+\frac {C e x^2}{2 c} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(A + B*x + C*x^2))/(a + c*x^2),x]

[Out]

((C*d + B*e)*x)/c + (C*e*x^2)/(2*c) + ((A*c*d - a*(C*d + B*e))*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2))
+ ((B*c*d + A*c*e - a*C*e)*Log[a + c*x^2])/(2*c^2)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 1629

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {(d+e x) \left (A+B x+C x^2\right )}{a+c x^2} \, dx &=\int \left (\frac {C d+B e}{c}+\frac {C e x}{c}+\frac {A c d-a (C d+B e)+(B c d+A c e-a C e) x}{c \left (a+c x^2\right )}\right ) \, dx\\ &=\frac {(C d+B e) x}{c}+\frac {C e x^2}{2 c}+\frac {\int \frac {A c d-a (C d+B e)+(B c d+A c e-a C e) x}{a+c x^2} \, dx}{c}\\ &=\frac {(C d+B e) x}{c}+\frac {C e x^2}{2 c}+\frac {(B c d+A c e-a C e) \int \frac {x}{a+c x^2} \, dx}{c}+\frac {(A c d-a (C d+B e)) \int \frac {1}{a+c x^2} \, dx}{c}\\ &=\frac {(C d+B e) x}{c}+\frac {C e x^2}{2 c}+\frac {(A c d-a (C d+B e)) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} c^{3/2}}+\frac {(B c d+A c e-a C e) \log \left (a+c x^2\right )}{2 c^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 86, normalized size = 0.92 \[ \frac {\log \left (a+c x^2\right ) (-a C e+A c e+B c d)-\frac {2 \sqrt {c} \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) (a B e+a C d-A c d)}{\sqrt {a}}+c x (2 B e+2 C d+C e x)}{2 c^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(A + B*x + C*x^2))/(a + c*x^2),x]

[Out]

(c*x*(2*C*d + 2*B*e + C*e*x) - (2*Sqrt[c]*(-(A*c*d) + a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/Sqrt[a] + (B
*c*d + A*c*e - a*C*e)*Log[a + c*x^2])/(2*c^2)

________________________________________________________________________________________

fricas [A]  time = 0.58, size = 206, normalized size = 2.22 \[ \left [\frac {C a c e x^{2} - {\left (B a e + {\left (C a - A c\right )} d\right )} \sqrt {-a c} \log \left (\frac {c x^{2} + 2 \, \sqrt {-a c} x - a}{c x^{2} + a}\right ) + 2 \, {\left (C a c d + B a c e\right )} x + {\left (B a c d - {\left (C a^{2} - A a c\right )} e\right )} \log \left (c x^{2} + a\right )}{2 \, a c^{2}}, \frac {C a c e x^{2} - 2 \, {\left (B a e + {\left (C a - A c\right )} d\right )} \sqrt {a c} \arctan \left (\frac {\sqrt {a c} x}{a}\right ) + 2 \, {\left (C a c d + B a c e\right )} x + {\left (B a c d - {\left (C a^{2} - A a c\right )} e\right )} \log \left (c x^{2} + a\right )}{2 \, a c^{2}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(C*a*c*e*x^2 - (B*a*e + (C*a - A*c)*d)*sqrt(-a*c)*log((c*x^2 + 2*sqrt(-a*c)*x - a)/(c*x^2 + a)) + 2*(C*a*
c*d + B*a*c*e)*x + (B*a*c*d - (C*a^2 - A*a*c)*e)*log(c*x^2 + a))/(a*c^2), 1/2*(C*a*c*e*x^2 - 2*(B*a*e + (C*a -
 A*c)*d)*sqrt(a*c)*arctan(sqrt(a*c)*x/a) + 2*(C*a*c*d + B*a*c*e)*x + (B*a*c*d - (C*a^2 - A*a*c)*e)*log(c*x^2 +
 a))/(a*c^2)]

________________________________________________________________________________________

giac [A]  time = 0.16, size = 91, normalized size = 0.98 \[ -\frac {{\left (C a d - A c d + B a e\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} + \frac {{\left (B c d - C a e + A c e\right )} \log \left (c x^{2} + a\right )}{2 \, c^{2}} + \frac {C c x^{2} e + 2 \, C c d x + 2 \, B c x e}{2 \, c^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x, algorithm="giac")

[Out]

-(C*a*d - A*c*d + B*a*e)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + 1/2*(B*c*d - C*a*e + A*c*e)*log(c*x^2 + a)/c^2
+ 1/2*(C*c*x^2*e + 2*C*c*d*x + 2*B*c*x*e)/c^2

________________________________________________________________________________________

maple [A]  time = 0.01, size = 133, normalized size = 1.43 \[ \frac {A d \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}}-\frac {B a e \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}\, c}-\frac {C a d \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}\, c}+\frac {C e \,x^{2}}{2 c}+\frac {A e \ln \left (c \,x^{2}+a \right )}{2 c}+\frac {B d \ln \left (c \,x^{2}+a \right )}{2 c}+\frac {B e x}{c}-\frac {C a e \ln \left (c \,x^{2}+a \right )}{2 c^{2}}+\frac {C d x}{c} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x)

[Out]

1/2*C*e*x^2/c+1/c*B*e*x+1/c*C*d*x+1/2/c*ln(c*x^2+a)*A*e+1/2/c*ln(c*x^2+a)*B*d-1/2/c^2*ln(c*x^2+a)*a*C*e+1/(a*c
)^(1/2)*arctan(1/(a*c)^(1/2)*c*x)*A*d-1/c/(a*c)^(1/2)*arctan(1/(a*c)^(1/2)*c*x)*B*a*e-1/c/(a*c)^(1/2)*arctan(1
/(a*c)^(1/2)*c*x)*C*a*d

________________________________________________________________________________________

maxima [A]  time = 0.97, size = 86, normalized size = 0.92 \[ -\frac {{\left (B a e + {\left (C a - A c\right )} d\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} + \frac {C e x^{2} + 2 \, {\left (C d + B e\right )} x}{2 \, c} + \frac {{\left (B c d - {\left (C a - A c\right )} e\right )} \log \left (c x^{2} + a\right )}{2 \, c^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x, algorithm="maxima")

[Out]

-(B*a*e + (C*a - A*c)*d)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + 1/2*(C*e*x^2 + 2*(C*d + B*e)*x)/c + 1/2*(B*c*d
- (C*a - A*c)*e)*log(c*x^2 + a)/c^2

________________________________________________________________________________________

mupad [B]  time = 3.78, size = 97, normalized size = 1.04 \[ \frac {x\,\left (B\,e+C\,d\right )}{c}-\frac {\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {a}}\right )\,\left (B\,a\,e-A\,c\,d+C\,a\,d\right )}{\sqrt {a}\,c^{3/2}}+\frac {C\,e\,x^2}{2\,c}+\frac {\ln \left (c\,x^2+a\right )\,\left (4\,A\,a\,c^3\,e+4\,B\,a\,c^3\,d-4\,C\,a^2\,c^2\,e\right )}{8\,a\,c^4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((d + e*x)*(A + B*x + C*x^2))/(a + c*x^2),x)

[Out]

(x*(B*e + C*d))/c - (atan((c^(1/2)*x)/a^(1/2))*(B*a*e - A*c*d + C*a*d))/(a^(1/2)*c^(3/2)) + (C*e*x^2)/(2*c) +
(log(a + c*x^2)*(4*A*a*c^3*e + 4*B*a*c^3*d - 4*C*a^2*c^2*e))/(8*a*c^4)

________________________________________________________________________________________

sympy [B]  time = 1.66, size = 337, normalized size = 3.62 \[ \frac {C e x^{2}}{2 c} + x \left (\frac {B e}{c} + \frac {C d}{c}\right ) + \left (- \frac {- A c e - B c d + C a e}{2 c^{2}} - \frac {\sqrt {- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right ) \log {\left (x + \frac {A a c e + B a c d - C a^{2} e - 2 a c^{2} \left (- \frac {- A c e - B c d + C a e}{2 c^{2}} - \frac {\sqrt {- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right )}{- A c^{2} d + B a c e + C a c d} \right )} + \left (- \frac {- A c e - B c d + C a e}{2 c^{2}} + \frac {\sqrt {- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right ) \log {\left (x + \frac {A a c e + B a c d - C a^{2} e - 2 a c^{2} \left (- \frac {- A c e - B c d + C a e}{2 c^{2}} + \frac {\sqrt {- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right )}{- A c^{2} d + B a c e + C a c d} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x**2+B*x+A)/(c*x**2+a),x)

[Out]

C*e*x**2/(2*c) + x*(B*e/c + C*d/c) + (-(-A*c*e - B*c*d + C*a*e)/(2*c**2) - sqrt(-a*c**5)*(-A*c*d + B*a*e + C*a
*d)/(2*a*c**4))*log(x + (A*a*c*e + B*a*c*d - C*a**2*e - 2*a*c**2*(-(-A*c*e - B*c*d + C*a*e)/(2*c**2) - sqrt(-a
*c**5)*(-A*c*d + B*a*e + C*a*d)/(2*a*c**4)))/(-A*c**2*d + B*a*c*e + C*a*c*d)) + (-(-A*c*e - B*c*d + C*a*e)/(2*
c**2) + sqrt(-a*c**5)*(-A*c*d + B*a*e + C*a*d)/(2*a*c**4))*log(x + (A*a*c*e + B*a*c*d - C*a**2*e - 2*a*c**2*(-
(-A*c*e - B*c*d + C*a*e)/(2*c**2) + sqrt(-a*c**5)*(-A*c*d + B*a*e + C*a*d)/(2*a*c**4)))/(-A*c**2*d + B*a*c*e +
 C*a*c*d))

________________________________________________________________________________________